package com.hdaccp.foodsales.controller;

import com.hdaccp.foodsales.entity.members;
import com.hdaccp.foodsales.service.MembersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/Mem")
@Scope("prototype")
public class MembersInfoController {

@Autowired
    //依赖注入
    private MembersService membersInfoService;



    @RequestMapping("/delet")
    @ResponseBody
    public int delet(int membersid){
        System.out.println(membersid+"---");
        return membersInfoService.dele(membersid);
    }

    @RequestMapping("/xg1")
    @ResponseBody
    public int xgl(members membersinfo){
        System.out.println(membersinfo.getMembersid()+"---");
        return membersInfoService.update(membersinfo);
}

    @RequestMapping("getqueryId")
    @ResponseBody
    public members getqueryId(int membersid){

        return membersInfoService.getById(membersid);
    }

    @RequestMapping("/inst")
    @ResponseBody
    public int inst(members membersinfo){
        return membersInfoService.zj(membersinfo);
    }

}
